const { Router } = require("express")
//  解构赋值      require("express") 返回一个  express对象
const user = require("../controller/index")



const multer = require('multer')
const upload = multer({ dest: 'state/uploads' })


const app = Router()



app.get('/login', user.login)


app.post("/registry", user.registry)

app.get('/', user.index)


app.post('/tologin', user.tologin)

app.post('/ore', user.ore)

app.post('/add', upload.single('avatar'), user.add)





app.post('/del', user.del)
app.post('/xgai', upload.single('avatar'), user.xgai)


module.exports = app